package com.gaxy.subject.application.controller;

import com.gaxy.subject.common.entity.PageResult;
import com.gaxy.subject.infra.basic.entity.SubjectInfoES;
import com.gaxy.subject.infra.basic.service.SubjectESService;
import com.gaxy.subject.infra.entity.UserInfo;
import com.gaxy.subject.infra.rpc.UserRpc;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * 刷题模块controller
 */
@RestController
@Slf4j
@RequestMapping("/subject/test")
public class TestFeignController {

    @Resource
    private UserRpc userRpc;

    @GetMapping("/testFeign")
    public UserInfo test(){
        UserInfo userInfo = userRpc.getUserInfo("gaxy");
        log.info("userinfo:{}", userInfo);
        return userInfo;
    }

}
